import fetch from '@/utils/fetch'
import axios from 'axios'


export function login(username, password) {
  return axios({
    url: '/oauth/token',
    method: 'post',
    data: {
      grant_type:'password',
      client_id:2,
      client_secret:'hE6xJTCh4qqJTFW0cVOc0OpPdOgMoxCExS46DTZe',
      username:username,
      password:password
    }
  })
}

export function getInfo(token) {
  return fetch({
    url: '/users/-1',
    method: 'get',
  })
}

export function logout() {
  return fetch({
    url: '/user/logout',
    method: 'post'
  })
}
